NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

4    
5    * Need to run the code 3 times for top5, top10, and top20 separately. Update the selection
5  ! below;
6    
7    %global projectrootdirectory;
8    %let projectrootdirectory = C:/Users/hpham13/Projects/mf_activism/empirical;
9    
10   /* Create local libraries */
11   libname rawdata "&projectrootdirectory./0_input/original";
NOTE: Libref RAWDATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mf_activism\empirical\0_input\original
12   libname save    "&projectrootdirectory./1_code/final_package_acceptance";
NOTE: Libref SAVE was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: 
      C:\Users\hpham13\Projects\mf_activism\empirical\1_code\final_package_acceptance
13   libname data    "C:/Users/hpham13/Projects/mutualfund/empirical/0_inputs/mfdb/Data/Original"
13 ! ;
NOTE: Libref DATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mutualfund\empirical\0_inputs\mfdb\Data\Original
14   
15   %global datadirectory;
16   %let datadirectory = C:/Users/hpham13/Data;
17   
18   libname lnk      "&datadirectory./Linking_tables/";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
19   libname ceo      "&datadirectory./ceo/";
NOTE: Libref CEO was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ceo
20   libname activism "&datadirectory./activism/";
NOTE: Libref ACTIVISM was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\activism
21   libname comp     "&datadirectory./compustat/fundq/";
NOTE: Libref COMP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\compustat\fundq
22   libname crsp     "&datadirectory./crsp/";
NOTE: Libref CRSP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\crsp
23   libname tr       "&datadirectory./ThomsonReuters/s12";
NOTE: Libref TR was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ThomsonReuters\s12
24   libname lnk      "&datadirectory./Linking_tables";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
25   libname mfl      "&datadirectory./Linking_tables/mflink2_20230828";
NOTE: Libref MFL was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables\mflink2_20230828
26   
27   /* Macros */
28   %include "&datadirectory./utils/do_over.sas";
335  %include "&datadirectory./utils/ff48.sas";
407  %include "&datadirectory./utils/ff49.sas";
480  %include "&datadirectory./utils/ff12.sas";
519  %include "&datadirectory./utils/winsorize.sas";
607   %include "&datadirectory./utils/lags.sas";
786   
787   
788   /* ******************************************************************************** */
789   /* PART 1:  Compute MF holdings "Adjusted Shares Held" from S12 and CRSP     ****** */
790   /* ******************************************************************************** */
791   %let begdate = 01MAR1995;
792   %let enddate = 31DEC2021;
793   
794   /* Get CRSP Prices, Returns, and Adjustment Factors from MSF Dataset */
795   data Price;
796       format QDATE date9.;
797       set crsp.msf (keep = permno date cfacpr cfacshr shrout prc ret);
NOTE: Data file CRSP.MSF.DATA is in a format that is native to another host, or the file 
      encoding does not match the session encoding. Cross Environment Data Access will be used, 
      which might require additional CPU resources and might reduce performance.
798       by permno date;
799       where date between "&begdate"d and "&enddate"d;
800       QDATE = intnx('QTR',   date, 0, 'E');
801       DATE  = intnx('MONTH', date, 0, 'E');
802       TSO   = shrout * cfacshr * 1000;
803       P     = abs(prc) / cfacpr;
804       P_1   = lag(P);
805       if first.permno then P_1 = .;
806       ME    = P * TSO / 1000000;
807       label TSO = "Total Shares Outstanding, Adjusted";
808       label P   = "Price at t Period End, Adjusted";
809       label P_1 = "Price at (t-1), Adjusted";
810       label ME  = "Market Capitalization, x$1m";
811       if TSO > 0;
812       format TSO comma12.0 ret percentn8.2 prc: dollar12.3;
813       drop prc cfacpr shrout;
814   run;

NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2011 PERMNO=13030 DATE=20111031 PRC=$17.330 RET=C SHROUT=200 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164928
NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2011 PERMNO=13030 DATE=20111130 PRC=$17.360 RET=0.17% SHROUT=300 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164929
NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2011 PERMNO=13030 DATE=20111231 PRC=$12.160 RET=-29.95% SHROUT=800 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164930
NOTE: Division by zero detected at line 803 column 22.
QDATE=31MAR2012 PERMNO=13030 DATE=20120131 PRC=$6.830 RET=-43.83% SHROUT=2500 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164931
NOTE: Division by zero detected at line 803 column 22.
QDATE=31MAR2012 PERMNO=13030 DATE=20120229 PRC=$5.490 RET=-19.62% SHROUT=19098 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164932
NOTE: Division by zero detected at line 803 column 22.
QDATE=30SEP2004 PERMNO=90298 DATE=20040731 PRC=$11.450 RET=C SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059434
NOTE: Division by zero detected at line 803 column 22.
QDATE=30SEP2004 PERMNO=90298 DATE=20040831 PRC=$11.720 RET=2.36% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059435
NOTE: Division by zero detected at line 803 column 22.
QDATE=30SEP2004 PERMNO=90298 DATE=20040930 PRC=$15.990 RET=36.43% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059436
NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2004 PERMNO=90298 DATE=20041031 PRC=$17.100 RET=6.94% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059437
NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2004 PERMNO=90298 DATE=20041130 PRC=$22.550 RET=31.87% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059438
NOTE: Division by zero detected at line 803 column 22.
QDATE=31DEC2004 PERMNO=90298 DATE=20041231 PRC=$16.250 RET=-27.01% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059439
NOTE: Division by zero detected at line 803 column 22.
QDATE=31MAR2005 PERMNO=90298 DATE=20050131 PRC=$16.890 RET=3.94% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059440
NOTE: Division by zero detected at line 803 column 22.
QDATE=31MAR2005 PERMNO=90298 DATE=20050228 PRC=$21.670 RET=28.30% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059441
NOTE: Division by zero detected at line 803 column 22.
QDATE=31MAR2005 PERMNO=90298 DATE=20050331 PRC=$18.550 RET=-13.43% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059442
NOTE: Division by zero detected at line 803 column 22.
QDATE=30JUN2005 PERMNO=90298 DATE=20050430 PRC=$15.600 RET=-15.90% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059443
NOTE: Division by zero detected at line 803 column 22.
QDATE=30JUN2005 PERMNO=90298 DATE=20050531 PRC=$15.940 RET=2.18% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059444
NOTE: Division by zero detected at line 803 column 22.
QDATE=30JUN2005 PERMNO=90298 DATE=20050630 PRC=$15.870 RET=-0.44% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059445
NOTE: Division by zero detected at line 803 column 22.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=0 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059446
NOTE: Division by zero detected at line 803 column 22.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=0 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059447
NOTE: Division by zero detected at line 803 column 22.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
QDATE=30SEP2005 PERMNO=90298 DATE=20050831 PRC=$15.410 RET=0.26% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059448
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      16861 at 802:20   64195 at 803:13   64195 at 803:22   64851 at 806:15   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      656 at 803:22   
NOTE: There were 2373587 observations read from the data set CRSP.MSF.
      WHERE (date>='01MAR1995'D and date<='31DEC2021'D);
NOTE: The data set WORK.PRICE has 2340645 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           9.07 seconds
      cpu time            3.31 seconds
      

815   
816   /* Keep Last Monthly Observation for Each Quarter */
817   data Price;
818       set Price;
819       by permno qdate date;
820       if last.qdate;
821   run;

NOTE: There were 2340645 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.PRICE has 788968 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.14 seconds
      cpu time            0.14 seconds
      

822   
823   /* Get report and vintage dates from Thomson-Reuters Mutual Fund Holdings */
824   /* Exclude Non-Equity Funds from Holdings data that is reported as of Fiscal Quarter End */
825   /* First, Keep First Vintage with Holdings Data for Each RDATE-FUNDNO */
826   proc sql;
827       create table First_Vint as
828       select distinct
829              intnx("month", rdate, 0, "E") as rdate format date9.,
830              fdate,
831              fundno
832       from tr.s12type1
833       where "&begdate"d <= rdate <= "&enddate"d
834         and ioc not in (1, 5, 6, 7)
835       group by fundno,
836                intnx("month", rdate, 0, "E")
837       having fdate = min(fdate)
838          and max(rdate) = rdate
839       order by fundno,
840                rdate desc;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 1552309 rows and 3 columns.

841   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.57 seconds
      cpu time            1.76 seconds
      

842   
843   /* Until 2003, funds were only required to disclose their holdings semi-annually */
844   /* Approximately 60% of funds additionally report quarterly holdings */
845   /* Use 6-Months as cut-off for portfolio holding period if the gap btw rdates is large */
846   data First_Vint;
847       set First_Vint;
848       by fundno descending rdate;
849       format nrdate date9.;
850   
851       nrdate = lag(rdate);
852       if first.fundno then nrdate = intnx("month", rdate, 6, "E");
853       nrdate = min(nrdate, intnx("month", rdate, 6, "E"));
854   run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: The data set WORK.FIRST_VINT has 1552309 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.27 seconds
      cpu time            0.28 seconds
      

855   
856   proc sort data = First_Vint nodupkey;
857       by fundno fdate;
858   run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: 14 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 1552295 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.09 seconds
      cpu time            0.26 seconds
      

859   
860   /* Add WFICN portfolio identifiers from MFLINKS */
861   proc sql;
862       create table First_Vint as
863       select b.wficn,
864              a.*
865       from First_Vint as a,
866            mfl.mflink2 as b
867       where a.fundno = b.fundno
868         and a.fdate  = b.fdate
869         and not missing(b.wficn);
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FIRST_VINT created, with 419694 rows and 5 columns.

870   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.74 seconds
      cpu time            0.53 seconds
      

871   
872   proc sort data = First_Vint nodupkey;
873       by wficn rdate;
874   run;

NOTE: There were 419694 observations read from the data set WORK.FIRST_VINT.
NOTE: 122 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 419572 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.12 seconds
      

875   
876   /* Add Total Number of S12 Filers During Each Quarter (NumInst) */
877   proc sql undo_policy = none;
878       create table First_Vint as
879       select distinct *,
880              count(fundno) as NumInst
881       from First_Vint
882       group by rdate
883       order by fdate,
884                fundno;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 419572 rows and 6 columns.

885   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.14 seconds
      cpu time            0.26 seconds
      

886   
887   /* Extract Holdings data by Merging TR-MF S12type1 and S12type3 Sets */
888   proc sql;
889       create view Holdings
890       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.cusip,b.shares
891       from First_Vint as a, tr.s12type3 as b
892       where a.fdate=b.fdate and a.fundno=b.fundno;
NOTE: SQL view WORK.HOLDINGS has been defined.
893   
894       create view Holdings1
895       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.permno,a.shares
896       from Holdings as a, (select distinct ncusip, permno from data.msenames
897                      where not missing(ncusip)) as b
898       where a.cusip=b.ncusip;
NOTE: SQL view WORK.HOLDINGS1 has been defined.
899   
900       create table Holdings2
901       as select b.date, a.rdate,a.nrdate,a.wficn,a.fundno,a.permno,a.NumInst,
902           a.shares*b.cfacshr as shares_adj label = "Adjusted Shares Held"
903       from Holdings1 as a, price as b
904       where a.permno=b.permno and a.fdate=b.qdate;
NOTE: Table WORK.HOLDINGS2 created, with 43478321 rows and 8 columns.

905   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           34.64 seconds
      cpu time            34.03 seconds
      

906   
907   /* Sanity Checks for Duplicates */
908   proc sort data = Holdings2
909             out  = MF_Holdings
910             nodupkey;
911       by wficn rdate permno;
912   run;

NOTE: There were 43478321 observations read from the data set WORK.HOLDINGS2.
NOTE: 23 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_HOLDINGS has 43478298 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           4.34 seconds
      cpu time            12.93 seconds
      

913   
914   
915   /* ******************************************************************************** */
916   /* Part 2:   Make a List of Domestic all-equity funds using CRSP MFDB   *********** */
917   /* ******************************************************************************** */
918   /* Extract CRSP Mutual Funds Performance and Characteristics */
919   /* Merge fraction of portfolio in equity assets with the objective code data */
920   proc sql;
921       create table Fund_Style as
922       select a.crsp_fundno,
923              a.si_obj_cd,
924              a.wbrger_obj_cd,
925              a.lipper_obj_cd,
926              a.lipper_obj_name,
927              a.lipper_asset_cd,
928              a.policy,
929              a.lipper_class,
930              a.crsp_obj_cd,
931              b.avrcs
932       from crsp.fund_style a
933       left join
934            (
935                select distinct crsp_fundno,
936                                sum(per_com) / count(per_com) as avrcs
937                from data.fund_summary2
938                group by crsp_fundno
939            ) b
940         on a.crsp_fundno = b.crsp_fundno;
NOTE: Table WORK.FUND_STYLE created, with 186445 rows and 10 columns.

941   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           2.36 seconds
      cpu time            0.85 seconds
      

942   
943   /* Sample Selection, focus on Domestic Equity Mutual Funds */
944   /* for which the holdings data are the most complete and reliable */
945   data Equity_Funds;
946       set Fund_Style;
947   
948       if not missing(Lipper_Class)
949          and lipper_class not in
950              ('EIEI','G','LCCE','LCGE','LCVE','MCCE',
951               'MCGE','MCVE','MLCE','MLGE','MLVE','SCCE','SCGE','SCVE')
952       then delete;
953       else if missing(Lipper_Class) then do;
954           if not missing(si_obj_cd)
955              and si_obj_cd not in ('AGG','GMC','GRI','GRO','ING','SCG')
956           then delete;
957           else if missing(si_obj_cd) then do;
958               if not missing(wbrger_obj_cd)
959                  and wbrger_obj_cd not in
959 ! ('G','G-I','AGG','GCI','GRI','GRO','LTG','MCG','SCG')
960               then delete;
961               else if missing(wbrger_obj_cd) then do;
962                   if not missing(policy) and policy ne 'CS' then delete;
963                   else if not missing(policy) and avrcs < 80 then delete;
964               end;
965           end;
966       end;
967   
968       keep crsp_fundno lipper_obj_cd lipper_obj_name crsp_obj_cd;
969   run;

NOTE: There were 186445 observations read from the data set WORK.FUND_STYLE.
NOTE: The data set WORK.EQUITY_FUNDS has 72495 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

970   
971   data names;
972       set crsp.fund_names (where = (fund_name ne ''));
973       by crsp_fundno;
974       if last.crsp_fundno;
975       keep crsp_fundno fund_name index_fund_flag;
976   run;

NOTE: There were 599342 observations read from the data set CRSP.FUND_NAMES.
      WHERE fund_name not = ' ';
NOTE: The data set WORK.NAMES has 71033 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.88 seconds
      cpu time            0.17 seconds
      

977   
978   /* identify index and target date funds and drop them from the sample */
979   data funds3;
980       merge Equity_Funds (in = in1)
981             names;
982       by crsp_fundno;
983       if in1;
984   run;

NOTE: There were 72495 observations read from the data set WORK.EQUITY_FUNDS.
NOTE: There were 71033 observations read from the data set WORK.NAMES.
NOTE: The data set WORK.FUNDS3 has 72495 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

985   
986   proc sql;
987       create table funds4 (drop = index_fund_flag) as
988       select *
989       from funds3
990       group by crsp_fundno
991       having count(index_fund_flag) = 0;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FUNDS4 created, with 68402 rows and 5 columns.

992   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.05 seconds
      cpu time            0.03 seconds
      

993   
994   data funds4;
995       set funds4;
996       format namex $140.;
997       namex = lowcase(fund_name);
998   
999       if max(index(namex, 'index'), index(namex, 's&p')) = 0;
1000      if max(index(namex, 'idx'), index(namex, 'dfa'), index(namex, 'program')) = 0;
1001      if max(indexw(namex, 'etf'),
1002             index(namex, 'exchange traded'),
1003             index(namex, 'exchange-traded')) = 0;
1004      if max(index(namex, 'target'),
1005             index(namex, '2005'),
1006             index(namex, '2005'),
1007             index(namex, '2010'),
1008             index(namex, '2015'),
1009             index(namex, '2020'),
1010             index(namex, '2025'),
1011             index(namex, '2030'),
1012             index(namex, '2035'),
1013             index(namex, '2040'),
1014             index(namex, '2045'),
1015             index(namex, '2050'),
1016             index(namex, '2055')) = 0;
1017  
1018      drop namex fund_name;
1019  run;

NOTE: There were 68402 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds
      

1020  
1021  * label missing obj code as other equity;
1022  data funds4;
1023      set funds4;
1024      if missing(lipper_obj_cd) then lipper_obj_cd = "OEQ";
1025      if lipper_obj_cd = "OEQ" then lipper_obj_name = "Other Equity Funds";
1026  run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1027  
1028  * Select only Equity Domestic;
1029  data funds4;
1030      set funds4;
1031      crsp_obj_cd_2 = substr(crsp_obj_cd, 1, 2);
1032      new_var       = tranwrd(lipper_obj_name, "&", "AND");
1033      new_varx      = upcase(new_var);
1034      drop lipper_obj_name new_var;
1035      rename new_varx = lipper_obj_name;
1036  run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

1037  data funds5;
1038      set funds4;
1039      if crsp_obj_cd_2 = "ED";
1040  run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS5 has 57904 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

1041  
1042  proc sql;
1043      create table MF_Port (where = (wficn ne .)) as
1044      select distinct b.wficn, a.crsp_fundno
1045      from funds5 as a
1046      left join mfl.mflink1 as b
1047        on a.crsp_fundno = b.crsp_fundno
1048      group by b.wficn
1049      order by wficn,
1050               crsp_fundno;
NOTE: A GROUP BY clause has been discarded because neither the SELECT clause nor the optional 
      HAVING clause of the associated table-expression referenced a summary function.
NOTE: Table WORK.MF_PORT created, with 17292 rows and 2 columns.

1051  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.05 seconds
      cpu time            0.03 seconds
      

1052  
1053  proc sort data = MF_Port;
1054      by wficn;
1055  run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1056  
1057  
1058  /* ******************************************************************************** */
1059  /* Part 3:   Merge the List of Domestic all-equity funds and Holdings   *********** */
1060  /* ******************************************************************************** */
1061  /* Merge Mutual Fund Holdings data and All-Equity Funds list */
1062  proc sort data = MF_Port;
1063      by wficn crsp_fundno;
1064  run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1065  
1066  data MF_merged;
1067      merge MF_Holdings (in = a)
1068            MF_Port     (in = b);
1069      by wficn;
1070      if b;
1071  run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: There were 43478298 observations read from the data set WORK.MF_HOLDINGS.
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_MERGED has 19605571 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           2.43 seconds
      cpu time            2.40 seconds
      

1072  
1073  %let md_rdate = (year(rdate) * 12 + month(rdate) - 1925 * 12 - 11);
1074  %let qd_rdate = (year(rdate) * 4  + qtr(rdate)   - 1925 * 4);
1075  
1076  data MF_merged;
1077      set MF_merged;
1078      md = &md_rdate;
1079      qd = &qd_rdate;
1080  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1226 at 1:3    1226 at 1:15   1226 at 1:3    1226 at 1:15   
NOTE: There were 19605571 observations read from the data set WORK.MF_MERGED.
NOTE: The data set WORK.MF_MERGED has 19605571 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           2.42 seconds
      cpu time            2.39 seconds
      

1081  
1082  proc sort data = MF_merged
1083            out  = MF_merged
1084            nodupkey;
1085      by wficn rdate permno;
1086  run;

NOTE: There were 19605571 observations read from the data set WORK.MF_MERGED.
NOTE: 646 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED has 19604925 observations and 11 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.16 seconds
      cpu time            5.09 seconds
      

1087  
1088  
1089  /* ******************************************************************************** */
1090  /* Part 4:   Merge holdings with Fund characteristics ***************************** */
1091  /* ******************************************************************************** */
1092  proc sort data = MF_Port;
1093      by crsp_fundno;
1094  run;

NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_PORT has 17292 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1095  
1096  /* get tna data */
1097  data returns1;
1098      merge MF_Port (in = in1)
1099            data.monthly_tna_ret_nav (drop = mnav);
1100      by crsp_fundno;
1101      if in1 = 1;
1102      if wficn ne .;
1103      if mtna < 0 then mtna = .;
1104      mtna = mtna + 0;
1105      mret = mret + 0;
1106      retain tna;
1107      if first.crsp_fundno or mtna ne . then tna = mtna;
1108      rename caldt = date;
1109      drop mtna;
1110  run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      210302 at 1104:17   96743 at 1105:17    
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: There were 8497746 observations read from the data set DATA.MONTHLY_TNA_RET_NAV.
NOTE: The data set WORK.RETURNS1 has 2559609 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           1.26 seconds
      cpu time            0.46 seconds
      

1111  
1112  /* get expense ratio data required to get gross returns */
1113  proc sql;
1114      create table returns2 as
1115      select a.*, b.exp_ratio
1116      from returns1 (rename = (tna = mtna)) as a
1117      left join data.fund_fees as b
1118        on a.crsp_fundno = b.crsp_fundno
1119       and date between b.begdt and b.enddt
1120      order by crsp_fundno,
1121               date;
NOTE: Table WORK.RETURNS2 created, with 2560265 rows and 6 columns.

1122  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.32 seconds
      cpu time            1.78 seconds
      

1123  
1124  /* compute gross returns */
1125  data returns2;
1126      set returns2;
1127      by crsp_fundno date;
1128      if exp_ratio = -99 then exp_ratio = .;
1129      weight = lag(mtna);
1130      if first.crsp_fundno then weight = mtna;
1131      rret = sum(mret, exp_ratio / 12);
1132  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      78755 at 1131:12    513949 at 1131:32   
NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 2560265 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.27 seconds
      cpu time            0.24 seconds
      

1133  
1134  /* aggregate multiple share classes */
1135  proc sort data = returns2;
1136      by wficn date;
1137  run;

NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 2560265 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.18 seconds
      cpu time            0.61 seconds
      

1138  
1139  data multiclass1 oneclass;
1140      set returns2;
1141      by wficn date;
1142      if first.date = 0 or last.date = 0 then output multiclass1;
1143      else output oneclass;
1144  run;

NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.MULTICLASS1 has 2035800 observations and 8 variables.
NOTE: The data set WORK.ONECLASS has 524465 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.16 seconds
      cpu time            0.15 seconds
      

1145  
1146  /* aggregate returns to the wficn-month level */
1147  proc sql;
1148      create table multiclass2 as
1149      select wficn,
1150             date,
1151             sum(mret * weight) / sum(weight) as mret,
1152             sum(mtna) as mtna,
1153             sum(rret * weight) / sum(weight) as rret
1154      from multiclass1
1155      group by wficn,
1156               date;
NOTE: Table WORK.MULTICLASS2 created, with 543345 rows and 5 columns.

1157  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.52 seconds
      cpu time            0.71 seconds
      

1158  
1159  /* create some local date vars for merging */
1160  %let md = (year(date) * 12 + month(date) - 1925 * 12 - 11);
1161  %let qd = (year(date) * 4  + qtr(date)   - 1925 * 4);
1162  
1163  data returns;
1164      set oneclass (drop = weight)
1165          multiclass2;
1166      md = &md;
1167      qd = &qd;
1168      rename mret = ret
1169             mtna = tna;
1170  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      86 at 1:3    86 at 1:14   86 at 1:3    86 at 1:14   
NOTE: There were 524465 observations read from the data set WORK.ONECLASS.
NOTE: There were 543345 observations read from the data set WORK.MULTICLASS2.
NOTE: The data set WORK.RETURNS has 1067810 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.12 seconds
      cpu time            0.10 seconds
      

1171  
1172  proc sort data = returns nodupkey;
1173      by wficn md;
1174  run;

NOTE: There were 1067810 observations read from the data set WORK.RETURNS.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.RETURNS has 1067810 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.09 seconds
      cpu time            0.25 seconds
      

1175  
1176  * house cleaning;
1177  proc datasets nowarn nolist nodetails;
NOTE: Writing HTML Body file: sashtml.htm
1178      delete multiclass1 multiclass2 oneclass returns1 returns2;
1179  quit;

NOTE: Deleting WORK.MULTICLASS1 (memtype=DATA).
NOTE: Deleting WORK.MULTICLASS2 (memtype=DATA).
NOTE: Deleting WORK.ONECLASS (memtype=DATA).
NOTE: Deleting WORK.RETURNS1 (memtype=DATA).
NOTE: Deleting WORK.RETURNS2 (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.32 seconds
      cpu time            0.20 seconds
      

1180  
1181  data returns;
1182      set returns;
1183      logtna = log(tna);
1184  run;

NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100302 crsp_fundno=008035 date=20080430 ret=0.008234 tna=0 exp_ratio=0.013000
rret=0.0093168663 md=989 qd=334 logtna=. _ERROR_=1 _N_=36579
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100302 crsp_fundno=008035 date=20080530 ret=0.026726 tna=0 exp_ratio=0.013000
rret=0.0278093912 md=990 qd=334 logtna=. _ERROR_=1 _N_=36580
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100503 crsp_fundno=006788 date=20080530 ret=0.038117 tna=0 exp_ratio=0.020000
rret=0.0397832586 md=990 qd=334 logtna=. _ERROR_=1 _N_=60662
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100552 crsp_fundno=013612 date=20080630 ret=. tna=0 exp_ratio=. rret=. md=991 qd=334
logtna=. _ERROR_=1 _N_=65022
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100552 crsp_fundno=013612 date=20080731 ret=. tna=0 exp_ratio=. rret=. md=992 qd=335
logtna=. _ERROR_=1 _N_=65023
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100685 crsp_fundno=008036 date=20080430 ret=0.054511 tna=0 exp_ratio=0.015000
rret=0.0557612782 md=989 qd=334 logtna=. _ERROR_=1 _N_=79237
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100685 crsp_fundno=008036 date=20080530 ret=0.044563 tna=0 exp_ratio=0.015000
rret=0.0458132799 md=990 qd=334 logtna=. _ERROR_=1 _N_=79238
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080430 ret=0.011013 tna=0 exp_ratio=0.022700
rret=0.0129048825 md=989 qd=334 logtna=. _ERROR_=1 _N_=91934
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080530 ret=0.052288 tna=0 exp_ratio=0.022700
rret=0.0541792484 md=990 qd=334 logtna=. _ERROR_=1 _N_=91935
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080630 ret=0.047619 tna=0 exp_ratio=0.022700
rret=0.0495107143 md=991 qd=334 logtna=. _ERROR_=1 _N_=91936
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080731 ret=-0.033597 tna=0 exp_ratio=0.021700
rret=-0.031788505 md=992 qd=335 logtna=. _ERROR_=1 _N_=91937
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080829 ret=-0.036810 tna=0 exp_ratio=0.021700
rret=-0.035001483 md=993 qd=335 logtna=. _ERROR_=1 _N_=91938
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20080930 ret=-0.097665 tna=0 exp_ratio=0.021700
rret=-0.09585621 md=994 qd=335 logtna=. _ERROR_=1 _N_=91939
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20081031 ret=0.002353 tna=0 exp_ratio=0.021700
rret=0.0041612745 md=995 qd=336 logtna=. _ERROR_=1 _N_=91940
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20081128 ret=0.002347 tna=0 exp_ratio=0.021700
rret=0.0041557512 md=996 qd=336 logtna=. _ERROR_=1 _N_=91941
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20081231 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=997 qd=336 logtna=. _ERROR_=1 _N_=91942
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20090130 ret=-0.002342 tna=0 exp_ratio=0.021700
rret=-0.000533587 md=998 qd=337 logtna=. _ERROR_=1 _N_=91943
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20090227 ret=-0.002347 tna=0 exp_ratio=0.021700
rret=-0.000539085 md=999 qd=337 logtna=. _ERROR_=1 _N_=91944
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
wficn=100789 crsp_fundno=009208 date=20090331 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=1000 qd=337 logtna=. _ERROR_=1 _N_=91945
NOTE: Invalid argument to function LOG(0) at line 1183 column 14.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
wficn=100789 crsp_fundno=009208 date=20090430 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=1001 qd=338 logtna=. _ERROR_=1 _N_=91946
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      9112 at 1183:14   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      179 at 1183:14   
NOTE: There were 1067810 observations read from the data set WORK.RETURNS.
NOTE: The data set WORK.RETURNS has 1067810 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.06 seconds
      cpu time            0.06 seconds
      

1185  
1186  * Obtain fund characteristics ;
1187  %let md = (year(caldt) * 12 + month(caldt) - 1925 * 12 - 11);
1188  %let qd = (year(caldt) * 4  + qtr(caldt)   - 1925 * 4);
1189  
1190  /* Get fund characteritics data */
1191  data fundchars;
1192      merge MF_Port (in = in1)
1193            data.fund_summary2;
1194      by crsp_fundno;
1195      md       = &md;
1196      qd       = &qd;
1197      fundage  = log(year(caldt) - year(first_offer_dt));
1198      per_cash2 = sum(per_cash, per_muni, per_govt) / 100;
1199      per_cash  = per_cash / 100;
1200      if wficn ne .;
1201      rename caldt = date;
1202      keep crsp_fundno wficn caldt date mgmt_fee turn_ratio first_offer_dt
1203           mgmt_name mgmt_cd fundage md qd per_cash per_muni per_govt
1204           per_cash2 nav_latest;
1205  run;

WARNING: The variable date in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000001 summary_period2=A caldt=19971231 summary_period=A
nav_latest=15.3000000 nav_latest_dt=19971231 tna_latest=81.000 tna_latest_dt=19971231
yield=0.0620065359 div_ytd=0.94870000000 cap_gains_ytd=0.02000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=88.13 per_muni=0 per_govt=3.34 per_oth=0.02 per_cash=0.0851
per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=9.8 maturity_dt=19980630
cusip8=  crsp_portno=. crsp_cl_grp=. fund_name=AARP Income Tr:Bond for Income ticker=AABIX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Stephen A Wohler mgr_dt=19970201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19970201 end_dt=20000731 dead_flag=Y
merge_fundno=008441 actual_12b1=0.000000 max_12b1=. mgmt_fee=-0.282000 exp_ratio=0.001900
turn_ratio=1.310000 fiscal_yearend=19980930 crsp_obj_cd=ICQM si_obj_cd=CMQ accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865
qd=292 fundage=. per_cash2=0.1185 _ERROR_=1 _N_=1
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=1 wficn=301534 crsp_fundno=000002 summary_period2=A caldt=19971231 summary_period=A
nav_latest=17.0900000 nav_latest_dt=19971231 tna_latest=72.000 tna_latest_dt=19971231
yield=0.0187244002 div_ytd=0.32000000000 cap_gains_ytd=0.10000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=98.55 per_cash=0.0145 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=AARP Mngd Inv Port Tr:Diversified Growth ticker=AADGX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Philip S Fortuna mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000831 dead_flag=Y merge_fundno=008425
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.000000 exp_ratio=0.000000 turn_ratio=0.060000
fiscal_yearend=19980930 crsp_obj_cd=EDYG si_obj_cd=GRO accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.0145 _ERROR_=1 _N_=10
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000003 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.4200000 nav_latest_dt=19931231 tna_latest=0.013 tna_latest_dt=19931231
yield=0.0574856046 div_ytd=0.59900000000 cap_gains_ytd=0.40580000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Rembrandt Funds:Global Fixed Income Fund/Inv ticker=  ncusip= 
mgmt_name=LaSalle Street Capital Mgmt Ltd mgmt_cd=  mgr_name=Roy Scheepe mgr_dt=19930201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930426 end_dt=20000831 dead_flag=Y merge_fundno=.
actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.015600 turn_ratio=1.460000
fiscal_yearend=. crsp_obj_cd=IF si_obj_cd=BGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0
_ERROR_=1 _N_=19
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000004 summary_period2=A caldt=19971231 summary_period=A
nav_latest=16.4600000 nav_latest_dt=19971231 tna_latest=23.800 tna_latest_dt=19971231
yield=0.0066828676 div_ytd=0.11000000000 cap_gains_ytd=0.15000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630
per_com=91.3 per_pref=1.1 per_conv=1.4 per_corp=0 per_muni=0 per_govt=0 per_oth=0.3
per_cash=0.059 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19980630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AARP Growth Tr:International Growth & Income ticker=AAISX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Sheridan Reilly mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000731 dead_flag=Y merge_fundno=008513
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.222000 exp_ratio=0.017500 turn_ratio=0.750000
fiscal_yearend=19980930 crsp_obj_cd=EFYT si_obj_cd=EIT accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.059 _ERROR_=1 _N_=32
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000008 summary_period2=A caldt=19901231 summary_period=A
nav_latest=13.2700000 nav_latest_dt=19901231 tna_latest=0.160 tna_latest_dt=19901231
yield=0.0021929164 div_ytd=0.02910000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=EQUITABLE BALANCED FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19990129 dead_flag=Y
merge_fundno=004089 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=54
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000009 summary_period2=A caldt=19871231 summary_period=A
nav_latest=10.7000000 nav_latest_dt=19871231 tna_latest=1.980 tna_latest_dt=19871231
yield=0.0002336449 div_ytd=0.00250000000 cap_gains_ytd=0.05510000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19871231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Equitable Balanced B ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name=  mgr_dt=19871001
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19870101 end_dt=19990129 dead_flag=Y
merge_fundno=004090 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=745 qd=252 fundage=. per_cash2=0
_ERROR_=1 _N_=64
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000010 summary_period2=A caldt=19931231 summary_period=A
nav_latest=15.2500000 nav_latest_dt=19931231 tna_latest=0.971 tna_latest_dt=19931231
yield=0.008852459 div_ytd=0.13500000000 cap_gains_ytd=1.17000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630
per_com=54.5 per_pref=0 per_conv=2.7 per_corp=4.7 per_muni=0 per_govt=13.1 per_oth=0
per_cash=0.25 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19940630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Alliance Port:Strategic Balanced Fund/C ticker=  ncusip= 
mgmt_name=ALLIANCE CAPITAL MANAGEMENT CORP. mgmt_cd=  mgr_name=Judith Taylor mgr_dt=19930801
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19990129 dead_flag=Y
merge_fundno=004091 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.021000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0.381
_ERROR_=1 _N_=77
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000012 summary_period2=A caldt=19941230 summary_period=A
nav_latest=14.3200000 nav_latest_dt=19941230 tna_latest=177.932 tna_latest_dt=19941230
yield=0.0275837989 div_ytd=0.39500000000 cap_gains_ytd=0.03900000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19950929 per_com=52
per_pref=0 per_conv=4 per_corp=4 per_muni=0 per_govt=19 per_oth=3 per_cash=0.18 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19950929 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AARP Growth Tr:Balanced Stock and Bond Fund ticker=ABSBX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Robert T Hoffman mgr_dt=19940201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19940201 end_dt=20000731 dead_flag=Y
merge_fundno=028248 actual_12b1=0.000000 max_12b1=. mgmt_fee=. exp_ratio=0.010100
turn_ratio=0.637700 fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=829 qd=280 fundage=.
per_cash2=0.37 _ERROR_=1 _N_=90
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000015 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.1700000 nav_latest_dt=19911231 tna_latest=5.750 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910801 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031048 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=121
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000016 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.2300000 nav_latest_dt=19911231 tna_latest=0.558 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/B ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19911101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031046 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=129
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000017 summary_period2=A caldt=19931231 summary_period=A
nav_latest=11.5500000 nav_latest_dt=19931231 tna_latest=2.570 tna_latest_dt=19931231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630 per_com=93 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0.07 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19940630 cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=American Capital World:Global Equity Fund/C ticker=ACGCX ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=Jeff New mgr_dt=19940401
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19980529 dead_flag=Y
merge_fundno=031045 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.032100
turn_ratio=1.160000 fiscal_yearend=. crsp_obj_cd=EFYG si_obj_cd=EGG accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0.07 _ERROR_=1 _N_=137
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000018 summary_period2=A caldt=19761231 summary_period=A
nav_latest=24.5800000 nav_latest_dt=19761231 tna_latest=11.100 tna_latest_dt=19761231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19761231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American General Muni Bond Fund ticker=ACMBX ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19880101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19760101 end_dt=19950831 dead_flag=Y
merge_fundno=030948 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=Bonds lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=613 qd=208 fundage=.
per_cash2=0 _ERROR_=1 _N_=143
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000019 summary_period2=A caldt=19921231 summary_period=A
nav_latest=10.0200000 nav_latest_dt=19921231 tna_latest=3.773 tna_latest_dt=19921231
yield=0.0185628743 div_ytd=0.18600000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=95 per_govt=0 per_oth=0 per_cash=0.05 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=21.3 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL MUNICIPAL BOND FUND/B ticker=  ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=ROBERT EVANS mgr_dt=19920901
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030949 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.017100 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=163
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000020 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.5200000 nav_latest_dt=19931231 tna_latest=4.137 tna_latest_dt=19931231
yield=0.0199619772 div_ytd=0.21000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American Capital Municipal Bond Fund/C ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19950401 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19930101
end_dt=19950831 dead_flag=Y merge_fundno=030950 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0 _ERROR_=1 _N_=167
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000021 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9800000 nav_latest_dt=19901231 tna_latest=15.582 tna_latest_dt=19901231
yield=0.0095190381 div_ytd=0.09500000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '97 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101
end_dt=19971128 dead_flag=Y merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000
turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=.
per_cash2=0 _ERROR_=1 _N_=170
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000022 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.7600000 nav_latest_dt=19911231 tna_latest=8.795 tna_latest_dt=19911231
yield=0.0269516729 div_ytd=0.29000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '98 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19930331 dead_flag=Y merge_fundno=006281 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=178
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000024 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9000000 nav_latest_dt=19901231 tna_latest=26.050 tna_latest_dt=19901231
yield=0.0001010101 div_ytd=0.00100000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Axe-Core Int'l ADR Fund ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19901101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19920630 dead_flag=Y
merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=182
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=1 wficn=100154 crsp_fundno=000025 summary_period2=A caldt=19921231 summary_period=A
nav_latest=17.6200000 nav_latest_dt=19921231 tna_latest=0.285 tna_latest_dt=19921231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19921231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Ambassador Funds:Established Co Gr/Retail A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19930501 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19920101
end_dt=19950531 dead_flag=Y merge_fundno=021286 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805
qd=272 fundage=. per_cash2=0 _ERROR_=1 _N_=185
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
in1=0 wficn=. crsp_fundno=000026 summary_period2=A caldt=19951229 summary_period=A
nav_latest=10.2100000 nav_latest_dt=19951229 tna_latest=0.202 tna_latest_dt=19951229
yield=0.0266405485 div_ytd=0.27200000000 cap_gains_ytd=0.05100000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19960329 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=97.4 per_govt=0 per_oth=0 per_cash=0.026 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19960329 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=Achievement Fds Trust:Short Term Muni/Retail ticker= 
ncusip=  mgmt_name=SEI FINANCIAL MANAGEMENT CORP. mgmt_cd=  mgr_name=James A Schuck
mgr_dt=19950301 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=L header=1 first_offer_dt=19950101 end_dt=19990331 dead_flag=Y
merge_fundno=. actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.010000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IUS si_obj_cd=MSM accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=0 LAST.crsp_fundno=0 md=841 qd=284 fundage=. per_cash2=1
_ERROR_=1 _N_=190
NOTE: Invalid argument to function LOG(0) at line 1197 column 16.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
in1=0 wficn=. crsp_fundno=000028 summary_period2=A caldt=19921231 summary_period=A
nav_latest=11.3500000 nav_latest_dt=19921231 tna_latest=11.986 tna_latest_dt=19921231
yield=0.0220264317 div_ytd=0.25000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=90 per_govt=0 per_oth=0 per_cash=0.1 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=19.6 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL TXEX TRUST-INSURED MUNI/B ticker=ACTJX
ncusip=  mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=BOB EVANS mgr_dt=19920701
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030993 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.018200 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MIS accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=206
NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      13 at 1:3           13 at 1:15          13 at 1:3           13 at 1:15
      24043 at 1197:16    13 at 1197:20       24043 at 1197:32    24043 at 1197:34
      453569 at 1198:17   453569 at 1198:51   453569 at 1199:26   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      123000 at 1197:16   
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: There were 2500116 observations read from the data set DATA.FUND_SUMMARY2.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.84 seconds
      cpu time            0.86 seconds
      

1206  
1207  proc sort data = fundchars;
1208      by wficn date;
1209  run;

NOTE: There were 737202 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.14 seconds
      cpu time            0.29 seconds
      

1210  
1211  * Get hand-checked management name and code;
1212  proc import out      = std_mgmt_names
1213              datafile =
1213! 'C:/Users/hpham13/Projects/mf_activism/empirical/0_input/original/mff_names_dedup2023.xlsx'
1214              dbms     = xlsx
1215              replace;
1216  run;

NOTE: One or more variables were converted because the data type is not supported by the V9 
      engine. For more details, run with options MSGLEVEL=I.
NOTE: The import data set has 3132 observations and 7 variables.
NOTE: WORK.STD_MGMT_NAMES data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.09 seconds
      cpu time            0.09 seconds
      

1217  
1218  proc sort data = std_mgmt_names nodupkey;
1219      by mgmt_name;
1220  run;

NOTE: There were 3132 observations read from the data set WORK.STD_MGMT_NAMES.
NOTE: 327 observations with duplicate key values were deleted.
NOTE: The data set WORK.STD_MGMT_NAMES has 2805 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1221  
1222  proc sql;
1223      create table fundchars as
1224      select a.*,
1225             b.corrected_mgmt_cd
1226      from fundchars as a
1227      left join std_mgmt_names as b
1228        on a.mgmt_name = b.mgmt_name;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FUNDCHARS created, with 737202 rows and 17 columns.

1229  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.26 seconds
      cpu time            0.43 seconds
      

1230  
1231  * if corrected_mgmt_cd is missing, replace by original mgmt_cd and rename ;
1232  data fundchars;
1233      set fundchars;
1234      if missing(corrected_mgmt_cd) and not missing(mgmt_cd) then corrected_mgmt_cd = mgmt_cd
1234! ;
1235      if missing(corrected_mgmt_cd) and missing(mgmt_cd) and not missing(mgmt_name) then
1235! corrected_mgmt_cd = mgmt_name;
1236      drop mgmt_cd;
1237      label corrected_mgmt_cd = "Management Company Code";
1238      rename corrected_mgmt_cd = mgmt_cd;
1239  run;

NOTE: There were 737202 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.09 seconds
      

1240  
1241  /* Merge data*/
1242  proc sql;
1243      create table returns_merged as
1244      select a.*, b.crsp_fundno, b.fundage, b.turn_ratio, b.md, b.qd, b.mgmt_name, b.mgmt_cd,
1245             b.per_cash, b.per_muni, b.per_govt, b.per_cash2, (b.per_cash * a.tna) as mfcash,
1246             (b.per_cash2 * a.tna) as mfcash2, b.nav_latest
1247      from returns (where = (date between "&begdate"d and "&enddate"d)) as a
1248      left join fundchars as b
1249        on a.wficn = b.wficn
1250       and a.qd    = b.qd;
WARNING: Variable crsp_fundno already exists on file WORK.RETURNS_MERGED.
WARNING: Variable md already exists on file WORK.RETURNS_MERGED.
WARNING: Variable qd already exists on file WORK.RETURNS_MERGED.
NOTE: Table WORK.RETURNS_MERGED created, with 2187051 rows and 21 columns.

1251  
1252      create view MF_merged2 as
1253      select a.*, b.tna label = 'TNA ($millions)', b.exp_ratio, b.rret, b.mgmt_name,
1253! b.mgmt_cd
1254      from MF_merged as a
1255      left join
1256           ( select wficn, md, qd, tna, exp_ratio, rret, mgmt_name, mgmt_cd
1257               from returns_merged
1258           ) as b
1259        on a.wficn = b.wficn
1260       and a.md    = b.md;
NOTE: SQL view WORK.MF_MERGED2 has been defined.
1261  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.91 seconds
      cpu time            1.10 seconds
      

1262  
1263  
1264  /* ******************************************************************************** */
1265  /* Part 5:   Compute ownership and define large holding families   **************** */
1266  /* ******************************************************************************** */
1267  proc sort data = MF_merged2
1268            out  = MF_merged3
1269            nodupkey;
1270      by permno rdate wficn;
1271  run;

NOTE: There were 57018050 observations read from the data set WORK.MF_MERGED2.
NOTE: 37413125 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED3 has 19604925 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           12.62 seconds
      cpu time            29.25 seconds
      

1272  
1273  data MF_merged3;
1274      set MF_merged3;
1275      if rdate ne .;
1276      if not missing(mgmt_cd);
1277  run;

NOTE: There were 19604925 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17727460 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           2.30 seconds
      cpu time            2.25 seconds
      

1278  
1279  proc sql;
1280      create table MF_merged3 as
1281      select *,
1282             sum(shares_adj) as shares_adj_mff
1283      from MF_merged3
1284      group by permno, rdate, mgmt_cd;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 17727460 rows and 17 columns.

1285  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           10.82 seconds
      cpu time            14.65 seconds
      

1286  
1287  proc sql;
1288      create table MF_merged3 as
1289      select *,
1290             count(distinct permno) as num_firms
1291      from MF_merged3
1292      group by mgmt_cd, rdate;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 17727460 rows and 18 columns.

1293  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           10.11 seconds
      cpu time            15.51 seconds
      

1294  
1295  proc sort data = MF_merged3;
1296      by permno rdate mgmt_cd;
1297  run;

NOTE: There were 17727460 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17727460 observations and 18 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           4.82 seconds
      cpu time            10.03 seconds
      

1298  
1299  * follow the literature, we exclude observations with TNA does not exceed $1mil and
1299! num_firms does not exceed 10;
1300  data MF_merged3;
1301      set MF_merged3;
1302      if tna > 1;
1303      if num_firms > 10;
1304  run;

NOTE: There were 17727460 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           2.83 seconds
      cpu time            2.21 seconds
      

1305  
1306  data MF_merged3;
1307      set MF_merged3;
1308      drop shares_adj exp_ratio rret;
1309  run;

NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           2.13 seconds
      cpu time            2.12 seconds
      

1310  
1311  data MF_merged3;
1312      set MF_merged3;
1313      rename shares_adj_mff = shares_adj;
1314      label shares_adj_mff = "Total shares at MFF";
1315  run;

NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           2.10 seconds
      cpu time            2.03 seconds
      

1316  
1317  * get TSO ;
1318  data MF_merged3;
1319      merge MF_merged3 (in = a)
1320            price      (in = b rename = (qdate = rdate));
1321      by permno rdate;
1322      if b and TSO > 0;
1323      MFOR = shares_adj / TSO;
1324      label MFOR = "MFOwn MFF-Firm-Level";
1325      format MFOR percentn8.4;
1326      format ME P_1 P comma8.4;
1327      if wficn ne .;
1328  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      369444 at 1323:23   
NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: There were 788968 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.MF_MERGED3 has 14317291 observations and 22 variables.
NOTE: DATA statement used (Total process time):
      real time           2.81 seconds
      cpu time            2.78 seconds
      

1329  
1330  * Compute the firm weight in a mutual fund portfolio at the mutual fund - quarter level;
1331  proc sql;
1332      create table MF_merged3 as
1333      select *,
1334             (shares_adj * P) / sum(shares_adj * P) as fweight
1335                 label  = "Firm weight"
1336                 format = percentn8.4
1337      from MF_merged3
1338      group by mgmt_cd, rdate
1339      order by mgmt_cd, rdate, permno;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 14317291 rows and 23 columns.

1340  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           10.58 seconds
      cpu time            19.01 seconds
      

1341  
1342  data MF_merged3;
1343      set MF_merged3;
1344      drop wficn fundno crsp_fundno;
1345      if not missing(mgmt_cd);
1346      ryear = year(rdate);
1347  run;

NOTE: There were 14317291 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 14317291 observations and 21 variables.
NOTE: DATA statement used (Total process time):
      real time           2.46 seconds
      cpu time            2.36 seconds
      

1348  proc sort data = MF_merged3 nodupkey;
1349      by mgmt_cd permno rdate;
1350  run;

NOTE: There were 14317291 observations read from the data set WORK.MF_MERGED3.
NOTE: 5172414 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED3 has 9144877 observations and 21 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.78 seconds
      cpu time            6.37 seconds
      

1351  
1352  * require at least 2 obs;
1353  proc sql;
1354      create table MF_merged3 as
1355      select * from MF_merged3
1356      group by mgmt_cd, permno
1357      having count(*) >=2 ;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 8900900 rows and 21 columns.

1358  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           3.09 seconds
      cpu time            2.59 seconds
      

1359  
1360  %let winsVars2 = MFOR ;
1361  %winsor(dsetin=work.MF_merged3, dsetout=work.MF_merged3, byvar=ryear, vars=&winsVars2,
1361! type=winsor, pctl=1 99);

NOTE: There were 8900900 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.XTEMP has 8900900 observations and 21 variables.
NOTE: DATA statement used (Total process time):
      real time           1.08 seconds
      cpu time            1.07 seconds
      


NOTE: There were 8900900 observations read from the data set WORK.XTEMP.
NOTE: The data set WORK.XTEMP has 8900900 observations and 21 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.85 seconds
      cpu time            5.01 seconds
      


NOTE: The data set WORK.XTEMP_PCTL has 26 observations and 3 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           5.37 seconds
      cpu time            5.23 seconds
      


WARNING: The variable xbyvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 8900900 observations read from the data set WORK.XTEMP.
NOTE: There were 26 observations read from the data set WORK.XTEMP_PCTL.
NOTE: The data set WORK.MF_MERGED3 has 8900900 observations and 21 variables.
NOTE: DATA statement used (Total process time):
      real time           1.50 seconds
      cpu time            1.49 seconds
      

1362  proc sql;
1362!           drop table xtemp, xtemp_pctl;
NOTE: Table WORK.XTEMP has been dropped.
NOTE: Table WORK.XTEMP_PCTL has been dropped.
1362!                                         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.12 seconds
      cpu time            0.12 seconds
      

1363  
1364  data MF_merged3; set MF_merged3;
1365      drop ryear;
1366  run;

NOTE: There were 8900900 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8900900 observations and 20 variables.
NOTE: DATA statement used (Total process time):
      real time           1.71 seconds
      cpu time            1.23 seconds
      

1367  
1368  * Compute the change of ownership and change of Firm weight;
1369  proc sort data= MF_merged3; by mgmt_cd permno rdate; run;

NOTE: There were 8900900 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8900900 observations and 20 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.30 seconds
      cpu time            4.20 seconds
      

1370  
1371  data MF_merged3; set MF_merged3;
1372      by mgmt_cd permno ;
1373      MFOR_l = lag(MFOR);
1374      fweight_l = lag(fweight);
1375      if first.permno then MFOR_l=.;
1376      if first.permno then fweight_l=.;
1377      changefweight = fweight - fweight_l ;
1378      changeMFOR = MFOR - MFOR_l ;
1379      /*assume no change for the first obs*/
1380      if first.permno then changefweight = 0 ;
1381      if first.permno then changeMFOR = 0 ;
1382      if first.permno then delete;
1383      drop MFOR_l fweight_l ;
1384      format fweight changefweight MFOR changeMFOR percentn8.4;
1385  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      868865 at 1377:29   863219 at 1378:23   
NOTE: There were 8900900 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 22 variables.
NOTE: DATA statement used (Total process time):
      real time           1.60 seconds
      cpu time            1.56 seconds
      

1386  
1387  
1388  * ************************************************
1389  *  make an indicator for large holding (>=1%);
1390  * ************************************************;
1391  data MF_merged3_1; set MF_merged3;
1392      MFORpct = round(MFOR*100, 0.01);
1393  run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3_1 has 8037681 observations and 23 variables.
NOTE: DATA statement used (Total process time):
      real time           1.41 seconds
      cpu time            1.18 seconds
      

1394  
1395  
1396  /* ******************************************************************************** */
1397  /* ROBUSTNESS METHODS : USE TOP5, TOP10, TOP20 ;*/
1398  /* ******************************************************************************** */
1399  * make a rank based on MFOR;
1400  proc sort data=MF_merged3; by permno rdate descending MFOR; run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 22 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.09 seconds
      cpu time            4.35 seconds
      

1401  data MF_merged3;
1402      set MF_merged3;
1403      by permno rdate;
1404      rnk+1;
1405      if first.rdate then rnk=1;
1406  run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 23 variables.
NOTE: DATA statement used (Total process time):
      real time           1.46 seconds
      cpu time            1.31 seconds
      

1407  
1408  * Second, Choose ONE of the following TopX threshold;
1409  
1410  * ****************************************************************;
1411  * method 1: USE TOP 5  MF BASED ON MFOR;
1412  * method 2: USE TOP 10 MF BASED ON MFOR;
1413  * method 3: USE TOP 20 MF BASED ON MFOR;
1414  * ****************************************************************;
1415  
1416  /*%let topx = 5  ; *top 5 ;*/
1417  /*%let topx = 10 ; *top 10;*/
1418  %let topx = 20 ; *top 20;
1419  
1420  data MF_merged3_1;
1421      set MF_merged3;
1422      if rnk<=&topx. then LargeMF = 1; else LargeMF = 0;
1423      if rnk =&topx. then topx = 1; else topx = 0 ;
1424  run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3_1 has 8037681 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           1.27 seconds
      cpu time            1.18 seconds
      

1425  
1426  
1427  * ****************************************************************;
1428  * method 2: USE TOP 10 MF BASED ON MFOR;
1429  * ****************************************************************;
1430  /*data MF_merged3_1;*/
1431  /*  set MF_merged3;*/
1432  /*  if rnk<=10 then LargeMF = 1; else LargeMF = 0;*/
1433  /*run;*/
1434  
1435  * ****************************************************************;
1436  * method 3: USE TOP 20 MF BASED ON MFOR;
1437  * ****************************************************************;
1438  /*data MF_merged3_1;*/
1439  /*  set MF_merged3;*/
1440  /*  if rnk<=20 then LargeMF = 1; else LargeMF = 0;*/
1441  /*run;*/
1442  
1443  
1444  proc sql;
1445      create table MF_merged3_1 as
1446      select *, max(LargeMF) as LargeMF2 label="Have LargeMF"
1447      from  MF_merged3_1
1448      where shares_adj > 0
1449      group by permno, rdate
1450      having LargeMF2=1
1451      order by permno, rdate, mgmt_cd;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3_1 created, with 8037681 rows and 26 columns.

1452  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           6.96 seconds
      cpu time            11.12 seconds
      

1453  
1454  
1455  
1456  /* ******************************************************************************** */
1457  /* Part 6:  Get identifers and date from Compustat  ******************************* */
1458  /* ******************************************************************************** */
1459  %let begdate = 01MAR1995;
1460  %let enddate = 31DEC2021;
1461  %let vars=  gvkey fyearq fqtr fyr rdq conm datadate indfmt datafmt popsrc consol saleq atq;
1462  data fundq;
1463     set comp.fundq_1950_2021 (keep= &vars);
1464     where datadate between "&begdate"d and "&enddate"d ;
1465     if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';
1466     format endfyr begfyr date9.;
1467     endfyr= datadate;
1468     begfyr= intnx('month',endfyr,-11,'beg');
1469     if atq>0;
1470     if saleq>0;
1471  run;

NOTE: There were 1240531 observations read from the data set COMP.FUNDQ_1950_2021.
      WHERE (datadate>='01MAR1995'D and datadate<='31DEC2021'D);
NOTE: The data set WORK.FUNDQ has 861686 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           3.84 seconds
      cpu time            0.35 seconds
      

1472  
1473  proc sort; by gvkey endfyr; run;

NOTE: There were 861686 observations read from the data set WORK.FUNDQ.
NOTE: The data set WORK.FUNDQ has 861686 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.14 seconds
      cpu time            0.25 seconds
      

1474  
1475  * Make a link GVKEYS to CRSP-PERMNO;
1476  proc sql;
1477    create table comp_lnk as select *
1478    from fundq as a, lnk.ccmxpf_lnkhist as b
1479    where a.gvkey = b.gvkey and
1480    b.LINKTYPE in ("LU","LC","LD","LN","LS","LX") and
1481    (b.LINKDT <= a.endfyr or b.LINKDT = .B) and (a.endfyr <= b.LINKENDDT or b.LINKENDDT = .E)
1481! ;
WARNING: Variable GVKEY already exists on file WORK.COMP_LNK.
NOTE: Table WORK.COMP_LNK created, with 624470 rows and 22 columns.

1482  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.14 seconds
      cpu time            0.14 seconds
      

1483  
1484  
1485  
1486  /* ******************************************************************************** */
1487  /* Part 7: Make the InformedTradeGrap variable  *********************************** */
1488  /* ******************************************************************************** */
1489  proc sql;
1490      create view MF_merged_comp1 as
1491      select a.gvkey, a.datadate, a.rdq, b.*
1492      from comp_lnk as a join MF_merged3_1 as b
1493      on a.lpermno=b.permno and
1494         year(a.datadate)=year(b.rdate) and qtr(a.datadate)=qtr(b.rdate);
NOTE: SQL view WORK.MF_MERGED_COMP1 has been defined.
1495  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

1496  
1497  proc sort
1498      data=MF_merged_comp1
1499      out=MF_merged_comp nodupkey ;
1500      by permno rdate mgmt_cd ;
1501  run;

NOTE: There were 8090846 observations read from the data set WORK.MF_MERGED_COMP1.
NOTE: 164903 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP has 7925943 observations and 29 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           4.84 seconds
      cpu time            6.39 seconds
      

1502  
1503  * read the abnormal return data;
1504  data abret_car;
1505      set rawdata.abret013024_capm;
1506  run;

NOTE: There were 816855 observations read from the data set RAWDATA.ABRET013024_CAPM.
NOTE: The data set WORK.ABRET_CAR has 816855 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.24 seconds
      cpu time            0.03 seconds
      

1507  proc sort data=abret_car nodupkey; by gvkey rdq; run;

NOTE: There were 816855 observations read from the data set WORK.ABRET_CAR.
NOTE: 9675 observations with duplicate key values were deleted.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.09 seconds
      cpu time            0.20 seconds
      

1508  
1509  * lead abnormal returns by 1 quarter;
1510  proc expand data = abret_car out=abret_car method=none ;
1511      by gvkey ;
1512      id rdq;
1513      convert abret = abret_lead / transformout = (lead 1);
1514      convert car   = car_lead / transformout = (lead 1);
1515  run;

NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: PROCEDURE EXPAND used (Total process time):
      real time           0.78 seconds
      cpu time            0.78 seconds
      

1516  
1517  data abret_car;
1518      set abret_car;
1519      label abret_lead="Abret t+1";
1520      label car_lead="CAR[-1,1] t+1";
1521  run;

NOTE: There were 807180 observations read from the data set WORK.ABRET_CAR.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds
      

1522  
1523  * merge Abnormal returns to MFF data;
1524  proc sql;
1525      create table MF_merged_comp as
1526      select a.*, b.car, b.abret, b.car_lead, b.abret_lead, b.logret, b.fyear
1527      from MF_merged_comp as a join abret_car as b
1528      on a.gvkey=b.gvkey and a.rdq=b.rdq;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP created, with 7792728 rows and 35 columns.

1529  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           2.78 seconds
      cpu time            2.76 seconds
      

1530  
1531  data MF_merged_comp;
1532      set MF_merged_comp;
1533      format car abret car_lead abret_lead comma8.5;
1534      stkpick1 = (changeMFOR * 100)    * (car_lead * 100);
1535      stkpick2 = (changefweight * 100) * (car_lead * 100);
1536      if stkpick1 ne .;
1537  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      77024 at 1534:50   958 at 1535:31     76999 at 1535:50   
NOTE: There were 7792728 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 7715704 observations and 37 variables.
NOTE: DATA statement used (Total process time):
      real time           2.01 seconds
      cpu time            1.53 seconds
      

1538  
1539  proc sql;
1540      create table MF_merged_comp2 as
1541      select   *
1542               ,avg(stkpick1) as avg_stkpick1_all
1543               ,avg(stkpick2) as avg_stkpick2_all
1544      from     MF_merged_comp
1545      group by permno, rdate
1546      order by permno, rdate, LargeMF ;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2 created, with 7715704 rows and 39 columns.

1547  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           7.55 seconds
      cpu time            12.01 seconds
      

1548  
1549  proc sql;
1550      create table MF_merged_comp2_1 as
1551      select   gvkey, datadate, rdq, car_lead, car
1552               ,permno, rdate, md, qd, LargeMF, mgmt_cd, MFOR
1553               ,topx
1554               ,stkpick1
1555               ,stkpick2
1556               ,avg_stkpick1_all
1557               ,avg_stkpick2_all
1558      from     MF_merged_comp2 ;
NOTE: Table WORK.MF_MERGED_COMP2_1 created, with 7715704 rows and 17 columns.

1559  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.96 seconds
      cpu time            0.93 seconds
      

1560  
1561  proc sql;
1562      create table MF_merged_comp2_2 as
1563      select   *
1564               ,avg(stkpick1) as avg_stkpick1
1565               ,avg(stkpick2) as avg_stkpick2
1566               ,count(mgmt_cd) as NumInst
1567               ,avg(MFOR)     as avgMFOR
1568               ,sum(MFOR)     as sumMFOR
1569      from     MF_merged_comp2_1
1570      group by permno, rdate, LargeMF
1571      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2_2 created, with 7715704 rows and 22 columns.

1572  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           2.15 seconds
      cpu time            2.15 seconds
      

1573  
1574  data MF_merged_comp2_2; set MF_merged_comp2_2;
1575      if LargeMF=1 then _stkpick1_Large = avg_stkpick1;
1576      if LargeMF=0 then _stkpick1_Small = avg_stkpick1;
1577  run;

NOTE: There were 7715704 observations read from the data set WORK.MF_MERGED_COMP2_2.
NOTE: The data set WORK.MF_MERGED_COMP2_2 has 7715704 observations and 24 variables.
NOTE: DATA statement used (Total process time):
      real time           0.89 seconds
      cpu time            0.87 seconds
      

1578  
1579  proc sql;
1580      create table MF_merged_comp2_3 as
1581      select *
1582             , max(_stkpick1_Large) as stkpick1_Large
1583             , max(_stkpick1_Small) as stkpick1_Small
1584      from MF_merged_comp2_2
1585      group by permno, rdate
1586      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2_3 created, with 7715704 rows and 26 columns.

1587  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           4.23 seconds
      cpu time            7.93 seconds
      

1588  data MF_merged_comp2_3; set MF_merged_comp2_3;
1589      drop _stkpick1_Large _stkpick1_Small;
1590      year = year(rdate);
1591  run;

NOTE: There were 7715704 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 7715704 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           1.24 seconds
      cpu time            1.04 seconds
      

1592  
1593  * treat outliers;
1594  %let winsVars = avg_stkpick1 avg_stkpick2 avg_stkpick1_all stkpick1_Large stkpick1_Small;
1595  %winsor(
1596      dsetin  = work.MF_merged_comp2_3,
1597      dsetout = work.MF_merged_comp2_3,
1598      byvar   = year,
1599      vars    = &winsVars,
1600      type    = winsor,
1601      pctl    = 1 99
1602  );

NOTE: There were 7715704 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.XTEMP has 7715704 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           0.80 seconds
      cpu time            0.79 seconds
      


NOTE: There were 7715704 observations read from the data set WORK.XTEMP.
NOTE: The data set WORK.XTEMP has 7715704 observations and 25 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           1.77 seconds
      cpu time            3.74 seconds
      


NOTE: The data set WORK.XTEMP_PCTL has 25 observations and 11 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           8.93 seconds
      cpu time            8.76 seconds
      


WARNING: The variable xbyvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 7715704 observations read from the data set WORK.XTEMP.
NOTE: There were 25 observations read from the data set WORK.XTEMP_PCTL.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 7715704 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           1.37 seconds
      cpu time            1.37 seconds
      

1603  proc sql;
1604      drop table xtemp, xtemp_pctl;
NOTE: Table WORK.XTEMP has been dropped.
NOTE: Table WORK.XTEMP_PCTL has been dropped.
1605  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.12 seconds
      cpu time            0.12 seconds
      

1606  
1607  * we compute the difference between LargeMF(=1) and smallMF (=0);
1608  proc sort data=MF_merged_comp2_3 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 7715704 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: 7229596 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 486108 observations and 25 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.88 seconds
      cpu time            1.71 seconds
      

1609  data MF_merged_comp2_3;
1610      set MF_merged_comp2_3;
1611      by permno rdate;
1612      Relstkpick1 = dif(avg_stkpick1);
1613      if first.permno or first.rdate then Relstkpick1 = .;
1614  run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 486108 observations and 26 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds
      

1615  
1616  proc sort data=MF_merged_comp2_3 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 486108 observations and 26 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.10 seconds
      cpu time            0.17 seconds
      

1617  data MF_merged_comp2_4;
1618      set MF_merged_comp2_3;
1619      by permno rdate;
1620      Relstkpick2 = dif(avg_stkpick2);
1621      if first.permno or first.rdate then Relstkpick2 = .;
1622  run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_4 has 486108 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           0.06 seconds
      cpu time            0.07 seconds
      

1623  proc sort data=MF_merged_comp2_4 nodupkey; by permno rdate  LargeMF ; run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_4.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_4 has 486108 observations and 27 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.10 seconds
      cpu time            0.18 seconds
      

1624  
1625  data MF_merged_comp2_4; set MF_merged_comp2_4;
1626      if LargeMF = 0 then _avgMFORsmall = avgMFOR; else _avgMFORsmall = 0 ;
1627      if LargeMF = 1 then _avgMFORlarge = avgMFOR; else _avgMFORlarge = 0 ;
1628      if LargeMF = 0 then _sumMFORsmall = sumMFOR; else _sumMFORsmall = 0 ;
1629      if LargeMF = 1 then _sumMFORlarge = sumMFOR; else _sumMFORlarge = 0 ;
1630      if LargeMF = 0 then _NumInstsmall = NumInst; else _NumInstsmall = 0 ;
1631      if LargeMF = 1 then _NumInstlarge = NumInst; else _NumInstlarge = 0 ;
1632  run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_4.
NOTE: The data set WORK.MF_MERGED_COMP2_4 has 486108 observations and 33 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.06 seconds
      

1633  
1634  * collapse data to the firm-quarter ;
1635  proc sql;
1636      create table MF_merged_comp2_4 as
1637      select *, max(_avgMFORsmall) as avgMFORsmall label="Avg of MFFOwn (small)",
1638                max(_avgMFORlarge) as avgMFORlarge label="Avg of MFFOwn (large)",
1639                max(_sumMFORsmall) as sumMFORsmall label="Sum of MFFOwn (small)",
1640                max(_sumMFORlarge) as sumMFORlarge label="Sum of MFFOwn (large)",
1641                max(_NumInstsmall) as NumInstsmall label="Number of MFF (small)",
1642                max(_NumInstlarge) as NumInstlarge label="Number of MFF (large)"
1643      from MF_merged_comp2_4
1644      group by permno, rdate;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP2_4 created, with 486108 rows and 39 columns.

1645  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.35 seconds
      cpu time            0.40 seconds
      

1646  
1647  data MF_merged_comp3; set MF_merged_comp2_4;
1648      drop avg_stkpick1 avg_stkpick2 LargeMF;
1649      if Relstkpick2 eq . then delete;
1650      ryear = year(rdate);
1651      format avgMFORsmall avgMFORlarge sumMFORsmall sumMFORlarge percent8.2;
1652      drop _avgMFORsmall _avgMFORlarge _sumMFORsmall _sumMFORlarge
1653          _NumInstsmall _NumInstlarge NumInst mgmt_cd avgMFOR sumMFOR;
1654  run;

NOTE: There were 486108 observations read from the data set WORK.MF_MERGED_COMP2_4.
NOTE: The data set WORK.MF_MERGED_COMP3 has 135680 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.06 seconds
      

1655  proc sort data=MF_merged_comp3 nodupkey; by permno rdate; run;

NOTE: There were 135680 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP3 has 135680 observations and 27 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.06 seconds
      

1656  
1657  proc sort data=MF_merged_comp3; by permno qd md; run;

NOTE: There were 135680 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP3 has 135680 observations and 27 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.03 seconds
      cpu time            0.04 seconds
      

1658  data MF_merged_comp4;
1659      retain gvkey datadate rdq permno rdate ryear;
1660      set MF_merged_comp3;
1661      by permno qd md;
1662      if last.qd;
1663  run;

NOTE: There were 135680 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP4 has 135680 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

1664  
1665  data MF_merged_comp4;
1666      set MF_merged_comp4;
1667      label avg_stkpick1_all = "InformedTrade All"
1668            stkpick1_Large   = "InformedTrade LH"
1669            stkpick1_Small   = "InformedTrade SH"
1670            Relstkpick1      = "InformedTradeGrap"
1671            Relstkpick2      = "InformedTradeGrap2";
1672  run;

NOTE: There were 135680 observations read from the data set WORK.MF_MERGED_COMP4.
NOTE: The data set WORK.MF_MERGED_COMP4 has 135680 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

1673  
1674  /* delete unneeded datasets */
1675  proc datasets nowarn nolist nodetails;
1676      delete MF_merged_comp
1677             MF_merged_comp1
1678             MF_merged_comp2
1679             MF_merged_comp3
1680             abret_car
1681             MFO_Metrics_comp
1682             MFO_TimeSeries_comp
1683             MFO_Metrics3
1684             MFO_TimeSeries3;
1685  run;

NOTE: Deleting WORK.MF_MERGED_COMP (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP3 (memtype=DATA).
NOTE: Deleting WORK.ABRET_CAR (memtype=DATA).
1686  quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.25 seconds
      cpu time            0.25 seconds
      

1687  
1688  
1689  * Save output - must run the code separately for each topx;
1690  
1691  /*data save.stkpick111624_mff_top5; */
1692  /*  set MF_merged_comp4;*/
1693  /*run;*/
1694  
1695  /*data save.stkpick111624_mff_top10; */
1696  /*  set MF_merged_comp4;*/
1697  /*run;*/
1698  
1699  data save.stkpick111624_mff_top20;
1700      set MF_merged_comp4;
1701  run;

NOTE: There were 135680 observations read from the data set WORK.MF_MERGED_COMP4.
NOTE: The data set SAVE.STKPICK111624_MFF_TOP20 has 135680 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

1702  
1703  proc printto;
1704  run;

